<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>${setting.siteName} - 基本参数</title>
    <meta name="keywords" content="${setting.siteName}">
    <meta name="description" content="${setting.siteName}">
    <!-- BEGIN HEADER -->
[#include "/admin/include/style.ftl"]
    <!-- END HEADER -->
    <style type="text/css">
    	body #d-content-Tips {
			z-index:200000 !important;
		}
		.modal-backdrop{
		z-index:2 !important;
		}
		.modal{
		z-index:3 !important;
		}
    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h3>基本参数</h3>
                </div>
                <div class="ibox-content">
                    <form id="inputForm" class="form-horizontal" action="update.jhtml" method="post">
                        <input type="hidden" id="id" value="${parameterSetting.id}"
                               name="id"/>
                                <div class="form-group">
                                    <div class="row">
                                                <div class="col-sm-6">
                                                    <label class="col-sm-3 control-label"> 平台联系电话</label>
                                                    <div class="col-sm-2">
                                                        <p class="form-control-static">${parameterSetting.AValue}</p>
                                                    </div>
                                                     <div class="col-sm-1">
                                                        <img style="margin-top:5px;" data-toggle="modal" data-target="#editModal" src="${base}/resources/img/bianji.png"/>
                                                    </div>
                                                </div>
                                    </div>
                                </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 模态框（Modal） -->
	<div class="modal fade" id="editModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" style="text-align: center;">
						设置</h4>
				</div>
				<div class="modal-body">
					<table class="table table-striped table-bordered table-hover dataTables-example dataTable">
                        <tr>
                        	<td style="width:30%;text-align: right;">平台联系电话</td>
                        	<td style="width:70%;"><input class="form-control" value="${parameterSetting.AValue}" id="modalValue"/></td>
                        </tr>
                    </table>
				</div>
				<div class="modal-footer">
                     <div class="col-sm-11">
						<button type="button" class="btn btn-sm btn-primary" style="float:right;" id="queren">确认</button>
						<span style="float:right;">&nbsp;&nbsp;</span>
						<button type="button" class="btn btn-sm" style="float:right;color:#fff;" data-dismiss="modal">取消</button>
					</div>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>
<!-- BEGIN Script -->
[#include "/admin/include/script.ftl"]
<!-- END Script -->
<script type="text/javascript">
	$('#queren').click(function () {
		$('#modalValue').css("border-color","#ddd");
		var id = $('#id').val();
		var _value = $('#modalValue').val();
		if (_value == '') {
			$('#modalValue').css("border-color","red");
		} else {
			$.ajax({
				url: '${base}/admin/parameter_setting/update_phone.jhtml',
				type: 'post',
				data: {
					id: id,
					aValue: _value
				},
				dataType: 'json',
				success: function(resp) {
					art.message(resp);
					if (resp.type == 'success') {
						$('#editModal').modal("hide");
						window.setTimeout(function() {
							window.location.reload();
						}, 1000);
					}
				}
			})
		} 
	})
</script>
</body>
</html>
